home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung 2 / Power-Programmierung CD 2 (Tewi)(1994).iso / gnu / djgpp / contrib / dvx / inc / x11 / xaw / toggle.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-07-15  |  5.7 KB  |  169 lines

  1. /*
  2.  * $XConsortium: Toggle.h,v 1.7 89/12/11 15:23:02 kit Exp $
  3.  *
  4.  * Copyright 1989 Massachusetts Institute of Technology
  5.  *
  6.  * Permission to use, copy, modify, distribute, and sell this software and its
  7.  * documentation for any purpose is hereby granted without fee, provided that
  8.  * the above copyright notice appear in all copies and that both that
  9.  * copyright notice and this permission notice appear in supporting
  10.  * documentation, and that the name of M.I.T. not be used in advertising or
  11.  * publicity pertaining to distribution of the software without specific,
  12.  * written prior permission.  M.I.T. makes no representations about the
  13.  * suitability of this software for any purpose.  It is provided "as is"
  14.  * without express or implied warranty.
  15.  *
  16.  * M.I.T. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
  17.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL M.I.T.
  18.  * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  19.  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
  20.  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 
  21.  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  22.  */
  23.  
  24. /*
  25.  * ToggleP.h - Private definitions for Toggle widget
  26.  *
  27.  * Author: Chris D. Peterson
  28.  *         MIT X Consortium
  29.  *         kit@expo.lcs.mit.edu
  30.  *  
  31.  * Date:   January 12, 1989
  32.  */
  33.  
  34. #ifndef _XawToggle_h
  35. #define _XawToggle_h
  36.  
  37. /***********************************************************************
  38.  *
  39.  * Toggle Widget
  40.  *
  41.  ***********************************************************************/
  42.  
  43. #include <X11/Xaw/Command.h>
  44.  
  45. /* Resources:
  46.  
  47.  Name             Class        RepType        Default Value
  48.  ----             -----        -------        -------------
  49.  radioGroup          RadioGroup         Widget          NULL              +
  50.  radioData           RadioData          Pointer         (caddr_t) Widget  ++
  51.  state               State              Boolean         Off
  52.  
  53.  background         Background        Pixel        XtDefaultBackground
  54.  bitmap             Pixmap        Pixmap        None
  55.  border             BorderColor    Pixel        XtDefaultForeground
  56.  borderWidth         BorderWidth    Dimension    1
  57.  callback         Callback        Pointer        NULL
  58.  cursor             Cursor        Cursor        None
  59.  destroyCallback     Callback        Pointer        NULL
  60.  font             Font        XFontStructx*    XtDefaultFont
  61.  foreground         Foreground        Pixel        XtDefaultForeground
  62.  height             Height        Dimension    text height
  63.  highlightThickness  Thickness        Dimension    2
  64.  insensitiveBorder   Insensitive    Pixmap        Gray
  65.  internalHeight         Height        Dimension    2
  66.  internalWidth         Width        Dimension    4
  67.  justify         Justify        XtJustify    XtJustifyCenter
  68.  label             Label        String        NULL
  69.  mappedWhenManaged   MappedWhenManaged    Boolean        True
  70.  resize             Resize        Boolean        True
  71.  sensitive         Sensitive        Boolean        True
  72.  width             Width        Dimension    text width
  73.  x             Position        Position    0
  74.  y             Position        Position    0
  75.  
  76. + To use the toggle as a radio toggle button, set this resource to point to
  77.   any other widget in the radio group.
  78.  
  79. ++ This is the data returned from a call to XtToggleGetCurrent, by default
  80.    this is set to the name of toggle widget.
  81.  
  82. */
  83.  
  84. /*
  85.  * These should be in StringDefs.h but aren't so we will define
  86.  * them here if they are needed.
  87.  */
  88.  
  89.  
  90. #define XtCWidget "Widget"
  91. #define XtCState "State"
  92. #define XtCRadioGroup "RadioGroup"
  93. #define XtCRadioData "RadioData"
  94.  
  95. #define XtRWidget "Widget"
  96.  
  97. #define XtNstate "state"
  98. #define XtNradioGroup "radioGroup"
  99. #define XtNradioData "radioData"
  100.  
  101. extern WidgetClass               toggleWidgetClass;
  102.  
  103. typedef struct _ToggleClassRec   *ToggleWidgetClass;
  104. typedef struct _ToggleRec        *ToggleWidget;
  105.  
  106.  
  107. /************************************************************
  108.  * 
  109.  * Public Functions
  110.  *
  111.  ************************************************************/
  112.    
  113. /*    Function Name: XawToggleChangeRadioGroup
  114.  *    Description: Allows a toggle widget to change radio lists.
  115.  *    Arguments: w - The toggle widget to change lists.
  116.  *                 radio_group - any widget in the new list.
  117.  *    Returns: none.
  118.  */
  119.  
  120. void XawToggleChangeRadioGroup(/* w, radio_group */);
  121. /* Widget w, radio_group; */
  122.  
  123. /*    Function Name: XawToggleGetCurrent
  124.  *    Description: Returns the RadioData associated with the toggle
  125.  *                   widget that is currently active in a toggle list.
  126.  *    Arguments: radio_group - any toggle widget in the toggle list.
  127.  *    Returns: The XtNradioData associated with the toggle widget.
  128.  */
  129.  
  130. caddr_t XawToggleGetCurrent(/* radio_group */);
  131. /* Widget radio_group; */
  132.  
  133. /*    Function Name: XawToggleSetCurrent
  134.  *    Description: Sets the Toggle widget associated with the
  135.  *                   radio_data specified.
  136.  *    Arguments: radio_group - any toggle widget in the toggle list.
  137.  *                 radio_data - radio data of the toggle widget to set.
  138.  *    Returns: none.
  139.  */
  140.  
  141. void XawToggleSetCurrent(/* radio_group, radio_data */);
  142. /* Widget radio_group;
  143.  * caddr_t radio_data;
  144.  */
  145.  
  146. /*    Function Name: XawToggleUnsetCurrent
  147.  *    Description: Unsets all Toggles in the radio_group specified.
  148.  *    Arguments: radio_group - any toggle widget in the toggle list.
  149.  *    Returns: none.
  150.  */
  151.  
  152. void XawToggleUnsetCurrent( /* radio_group */);
  153. /* Widget radio_group; */
  154.  
  155. #ifdef XAW_BC
  156. /*************************************************************
  157.  * For Compatibility only.                                   */
  158.  
  159. #define XtToggleChangeRadioGroup       XawToggleChangeRadioGroup
  160. #define XtToggleSetCurrent             XawToggleSetCurrent
  161. #define XtToggleUnsetCurrent           XawToggleUnsetCurrent
  162. #define XtToggleGetCurrent             XawToggleGetCurrent
  163.  
  164. /*************************************************************/
  165. #endif /* XAW_BC */
  166.  
  167. #endif /* _XawToggle_h */
  168. /* DON'T ADD STUFF AFTER THIS */
  169.